<!--
 *************************************************************************
 * The contents of this file are subject to the Openbravo  Public  License
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
 * Version 1.1  with a permitted attribution clause; you may not  use this
 * file except in compliance with the License. You  may  obtain  a copy of
 * the License at http://www.openbravo.com/legal/license.html 
 * Software distributed under the License  is  distributed  on  an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific  language  governing  rights  and  limitations
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SLU 
 * All portions are Copyright (C) 2010-2012 Openbravo SLU 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
-->

<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Instance Purpose Configuration</title>
  <link rel="shortcut icon" href="../../../../../web/images/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="../../../../../web/skins/Default/Openbravo_ERP_250.css" id="paramCSS"></link>
  <script language="JavaScript" type="text/javascript" id="paramDirectory">var baseDirectory = "../../../../../web/";</script>
  <script language="JavaScript" type="text/javascript" id="paramLanguage">var defaultLang = "en_US";</script>
  <script language="JavaScript" type="text/javascript" id="paramNewTabTitle">var newTabTitle = "XX";</script>
  <script language="JavaScript" src="../../../../../web/js/shortcuts.js" type="text/javascript"></script> 
  <script language="JavaScript" src="../../../../../web/js/utils.js" type="text/javascript"></script>
  <script language="JavaScript" src="../../../../../web/js/windowKeyboard.js" type="text/javascript"></script>
  <script language="JavaScript" src="../../../../../web/js/appStatus.js" type="text/javascript"></script>
 
  <script language="JavaScript" type="text/javascript" id="paramCMD">var cmd = 'PROCEED';</script>
 
  <script language="JavaScript" type="text/javascript">
  function continueButton() {
    if (!isWindowInMDIContext) {
      openLink('../ad_forms/InstanceManagement.html', 'appFrame');
    } else {
      getFrame('LayoutMDI').OB.Layout.ViewManager.openView("ClassicOBWindow",  {viewId: "ClassicOBWindow", obManualURL: '/ad_forms/InstanceManagement.html', id: '/ad_forms/InstanceManagement.html', formId: '8D6282279F464B1696B0EE3E23023B65', command: "DEFAULT", tabTitle: newTabTitle});
    }
    closePage();
  }
  function buttonOK() {
    var purpose = document.frmMain.instancePurpose;
    if (purpose.value == null || purpose.value == "") {
      displayLogicElement('noPurposeSelected', true);
      setWindowElementFocus(purpose);
      return false;
    }

    var command = typeof cmd === 'undefined' ? 'PROCEED' : cmd;
    setProcessingMode('popup', true);
    submitCommandForm(command, false, null);

    if (!isWindowInMDIContext) {
      var appFrame = getFrame('appFrame');
      if (appFrame && !appFrame.updatePurposeImage) {
        if (appFrame.document.getElementById('buttonRefresh')) {
          appFrame.document.getElementById('buttonRefresh').onclick();
        }
      } else if (appFrame) {
        appFrame.updatePurposeImage(purpose.value);
      }
    } else {
      var mdiFrame = getFrame('LayoutMDI'); 
      mdiFrame.OB.Application.purpose = purpose.value;
      if (mdiFrame.OB.Application.brandingWidget) {
        mdiFrame.OB.Application.brandingWidget.update();
      }
    }
  }
  </script>
  <script language="JavaScript" type="text/javascript">
  function onLoadDo(){
    this.windowTables = new Array(
      new windowTableId('client', 'buttonContinue')
    );
    setWindowTableParentElement();
    enableShortcuts('popup');
    setBrowserAutoComplete(false);

    displayLogicElement('noPurposeSelected', false);
    var showPurposeCombo = document.frmMain.showPurposeCombo.value == 'Y';
    displayLogicElement('purposeComboRow1', showPurposeCombo);
    displayLogicElement('purposeComboRow2', showPurposeCombo);

    var showButtonProceed = document.frmMain.showButtonProceed.value == 'Y';
    displayLogicElement('buttonProceed', showButtonProceed);
    displayLogicElement('buttonContinue', !showButtonProceed);

    setWindowElementFocus('firstElement');
  }

  function onResizeDo(){
  }
  </script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadDo();" onresize="onResizeDo();">

<div class="Popup_Wallpaper_Background Popup_Wallpaper_Background_Heartbeat">
  <img src="../../../../../web/images/blank.gif" class="Popup_Wallpaper_Image"></img>
</div>

<form method="post" action="InstancePurpose.html" name="frmMain" style="position: relative;">
<input type="hidden" name="Command" />
<input type="hidden" name="IsPopUpCall" value="1" />
<input type="hidden" id="paramRecordId" name="inpcRecordId" value="xx" />
<input type="hidden" id="paramShowPurposeCombo" name="showPurposeCombo" value="Y" />
<input type="hidden" id="paramShowButtonProceed" name="showButtonProceed" value="Y" />

<div class="Popup_ContentPane_CircleLogo">
  <div class="Popup_WindowLogo">
    <img class="Popup_WindowLogo_Icon Popup_WindowLogo_Icon_instancePurpose" src="../../../../../web/images/blank.gif" border=0/></img>
  </div>
</div>

<table cellspacing="0" cellpadding="0" width="100%">

  <tr>
    <td>
      <table cellspacing="0" cellpadding="0" class="Popup_ContentPane_NavBar">
        <tr class="Popup_NavBar_bg"><td></td>
          <td class="Popup_NavBar_separator_cell"></td>
          <td class="Popup_NavBar_bg_logo_left"></td>
          <td class="Popup_NavBar_bg_logo" width="1" onclick="openNewBrowser('http://www.openbravo.com', 'Openbravo');return false;"><img src="../../../../../web/images/blank.gif" alt="Openbravo" title="Openbravo" border="0" id="openbravoLogo" class="Popup_NavBar_logo" /></td>
          <td class="Popup_NavBar_bg_logo_right"></td>
          <td class="Popup_NavBar_Popup_title_cell"><span id="paramTitle">xxInstance Purpose Configuration</span></td>
          <td class="Popup_NavBar_separator_cell"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table cellspacing="0" cellpadding="0" class="Popup_ContentPane_SeparatorBar">
        <tr>
          <td class="Popup_SeparatorBar_bg"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <div class="Popup_ContentPane_Client" style="overflow: auto; background: none !important;">
        <table cellspacing="0" cellpadding="0" class="Popup_Client_TablePopup" style="background: none !important;">

          <tr>
            <td>
              <p class="Wide_Paragraph" id="paramWelcome">xxWelcome to Openbravo ERP</p>
          </td>
          </tr>
        </table>
      </div> 
    </td>
  </tr>
  <tr>
    <td>
      <div class="Popup_ContentPane_Client" style="overflow: auto; background: none !important;" id="client">
        <table cellspacing="0" cellpadding="0" class="Popup_Client_TablePopup" style="background: none !important;">
          <tbody><tr>
            <td class="TableEdition_OneCell_width"/>
            <td class="TableEdition_OneCell_width"/>
            <td class="TableEdition_OneCell_width"/>
            <td class="TableEdition_OneCell_width"/>
          </tr>
          <tr><td height="20" colspan="4"></td></tr>
          <tr id="purposeComboRow1" style="height: 30px;"><td colspan="4"><span class="LabelText">What is the purpose of this Openbravo ERP instance?</span></td></tr>
          <tr></tr>
          <tr id="purposeComboRow2">
            <td class="Combo_ContentCell" colspan="4"><select name="instancePurpose" id="inpInstancePurpose" class="ComboKey Combo_OneCell_width" required="yes">
                <option value="">--please select--</option>
                <div id="reportPurpose"></div>
            </select><span id="noPurposeSelected" class="LabelText" style="color:red; font-weight: bold; padding-left: 10px;">You must select a purpose</span></td>
          </tr>

          <tr>
            <td/>
            <td class="Button_RightAlign_ContentCell">
              <div>
                <button type="button" 
                  id="buttonContinue" 
                  class="ButtonLink" 
                  onclick="continueButton();return false;" 
                  onfocus="buttonEvent('onfocus', this); window.status='Continue'; return true;" 
                  onblur="buttonEvent('onblur', this);" 
                  onkeyup="buttonEvent('onkeyup', this);" 
                  onkeydown="buttonEvent('onkeydown', this);" 
                  onkeypress="buttonEvent('onkeypress', this);" 
                  onmouseup="buttonEvent('onmouseup', this);" 
                  onmousedown="buttonEvent('onmousedown', this);" 
                  onmouseover="buttonEvent('onmouseover', this); window.status='Continue'; return true;" 
                  onmouseout="buttonEvent('onmouseout', this);">
                  <table class="Button">
                    <tr>
                      <td class="Button_left"><img class="Button_Icon Button_Icon_ok" alt="Continue" title="Continue" src="../../../../../web/images/blank.gif" border="0" /></td>
                      <td class="Button_text Button_width">Continue</td>
                      <td class="Button_right"></td>
                    </tr>
                  </table>
                </button>
                <button type="button" 
                  id="buttonProceed" 
                  class="ButtonLink" 
                  onclick="buttonOK();return false;" 
                  onfocus="buttonEvent('onfocus', this); window.status='Proceed'; return true;" 
                  onblur="buttonEvent('onblur', this);" 
                  onkeyup="buttonEvent('onkeyup', this);" 
                  onkeydown="buttonEvent('onkeydown', this);" 
                  onkeypress="buttonEvent('onkeypress', this);" 
                  onmouseup="buttonEvent('onmouseup', this);" 
                  onmousedown="buttonEvent('onmousedown', this);" 
                  onmouseover="buttonEvent('onmouseover', this); window.status='Proceed'; return true;" 
                  onmouseout="buttonEvent('onmouseout', this);">
                  <table class="Button">
                    <tr>
                      <td class="Button_left"><img class="Button_Icon Button_Icon_ok" alt="Proceed" title="Proceed" src="../../../../../web/images/blank.gif" border="0" /></td>
                      <td class="Button_text Button_width">Proceed</td>
                      <td class="Button_right"></td>
                    </tr>
                  </table>
                </button>
              </div>
            </td>
            <td/>
            <td/>
          </tr>
        </tbody></table>
      </div>
    </td>
  </tr>
</table>
</form>
</body>
</html>
